package com.nvt.core.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nvt.core.dao.IHibernateDAO;
import com.nvt.core.exception.NvtBusinessException;

@Service
public class HibernateServiceImpl implements IHibernateService {

	@Autowired
	private IHibernateDAO hibernateDAO;

	@Override
	public Object executeInsert(Object objectDomain)
			throws NvtBusinessException {
		try {
			return hibernateDAO.executeInsert(objectDomain);
		} catch (Exception e) {
			throw new NvtBusinessException();
		}
	}

	@Override
	public void executeUpdate(Object objectDomain) throws NvtBusinessException {
		try {
			hibernateDAO.executeUpdate(objectDomain);
		} catch (Exception e) {
			throw new NvtBusinessException();
		}
	}

}
